import "package:ct_pa_majordomo/pages/bill/index.dart";
import "package:ct_pa_majordomo/pages/device/collect/index.dart";
import "package:ct_pa_majordomo/pages/device/electricity_meter/index.dart";
import "package:ct_pa_majordomo/pages/device/entrance_guard/index.dart";
import "package:ct_pa_majordomo/pages/device/gateway/add_gateway/index.dart";
import "package:ct_pa_majordomo/pages/device/gateway/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/detail/index.dart";
import "package:ct_pa_majordomo/pages/device/lock/index.dart";
import "package:ct_pa_majordomo/pages/home/notice_list.dart";
import "package:ct_pa_majordomo/pages/home/notice_detail.dart";
import "package:ct_pa_majordomo/pages/main.dart";
import "package:ct_pa_majordomo/pages/mine/setting.dart" as mine_setting ;
import "package:ct_pa_majordomo/pages/pre_check_in/audit/index.dart";
import "package:ct_pa_majordomo/pages/pre_check_in/index.dart";
import "package:ct_pa_majordomo/pages/pre_check_in/edit/index.dart";
import "package:ct_pa_majordomo/pages/user/create_apartment/index.dart";
import "package:ct_pa_majordomo/pages/user/index.dart";
import "package:ct_pa_majordomo/router/keys.dart";
import "package:ct_pa_majordomo/router/routes_module/apartment.dart";
import "package:ct_pa_majordomo/router/routes_module/bill.dart";
import "package:ct_pa_majordomo/router/routes_module/check_in_detail.dart";
import "package:ct_pa_majordomo/router/routes_module/collect.dart";
import "package:ct_pa_majordomo/router/routes_module/common.dart";
import "package:ct_pa_majordomo/router/routes_module/electricity_meter.dart";
import "package:ct_pa_majordomo/router/routes_module/entranceguard.dart";
import "package:ct_pa_majordomo/router/routes_module/gateway.dart";
import "package:ct_pa_majordomo/router/routes_module/lock.dart";
import "package:ct_pa_majordomo/router/routes_module/mine.dart";
import "package:flutter/cupertino.dart";
import "package:ct_pa_majordomo/pages/apartment/utilities_recharge/index.dart";
import "package:ct_pa_majordomo/pages/apartment/recharge/index.dart";
import "package:ct_pa_majordomo/pages/pre_check_in/check_in/index.dart";

class Routes {
  ///命名路由 跳转
  static Map<String, WidgetBuilder> getRoutes(BuildContext context) {
    return {
      ///登录
      Keys.LOGIN: (context, {arguments}) => const User(),
      ///主页面
      Keys.MAIN: (context, {arguments}) => Main(index: arguments["index"], params: arguments["params"],),
      ///创建公寓
      Keys.CREATE_APARTMENT: (context, {arguments}) => const CreateApartment(),
      
      ///消息列表
      Keys.NOTICE_LIST: (context, {arguments}) => const NoticeList(),
      ///消息详情
      Keys.NOTICE_DETAIL: (context, {arguments}) => NoticeDetail(arguments: arguments),
      
      ///预登记
      Keys.PRE_CHECK_IN: (context, {arguments}) => const PreCheckIn(),
      ///预登记 审核/详情
      Keys.PRE_CHECK_IN_AUDIT: (context, {arguments}) => PreCheckInAudit(registerId: arguments["registerId"], isAudit: arguments["isAudit"]),
      ///办理入住
      Keys.PRE_CHECK_IN_CHECK_IN: (context, {arguments}) => PreCheckInCheckIn(registerId: arguments["registerId"], room: arguments["room"]),
      ///新增/编辑预登记
      Keys.PRE_CHECK_IN_EDIT: (context, {arguments}) => PreCheckInEdit(registerId: arguments["registerId"]),

      ...ApartmentRoutes.getRoutes(context),

      ///门禁模块
      ...EntranceguardRoutes.getRoutes(context),

      ///门锁
      ...LockRoutes.getRoutes(context),

      ///电表
      ...ElectricityMeterRoutes.getRoutes(context),

      ///网关
      ...GatewayRoutes.getRoutes(context),

      ///采集器
      ...CollectRoutes.getRoutes(context),

      ///账单管理
      ...BillRoutes.getRoutes(context),


      ///入住详情模块
      ...CheckInDetailRoutes.getRoutes(context),


      ///个人中心 设置
      Keys.MINE_SETTING: (context, {arguments}) => const mine_setting.Setting(),
      ...MineRoutes.getRoutes(context),

      /// 通用页面
      ...CommonRoutes.getRoutes(context),

      Keys.APARTMENT_UTILITIES_RECHARGE: (context, {arguments}) => UtilitiesRechargePage(arguments: arguments),
      Keys.APARTMENT_RECHARGE: (context, {arguments}) => RechargePage(arguments: arguments),

    };
  }

  static List<String> whiteList = [
    "/login",
    "/mine/setting",
    "/main",
    "/notice/list",
    "/notice/detail"
  ];
}